module DQ
! 作者：何光辉,
! 邮箱：flamehe@163.com
    implicit none
    real(16), parameter :: pi = 3.141592653589793238462643383279502884197169399375105820974944592q0
    interface
        subroutine DQCoeff(xlist, maxorder, c)
            !xlist: input, one-dimensional real list, with length n
            !maxorder : input, interger
            !c : output, differential quadrature coefficient array, with dimensions (0:maxorder, n, n)
            integer(4), parameter :: iwp=SELECTED_REAL_KIND(32)  
            integer(4) :: maxorder
            real(kind=iwp) :: xlist(:)
            real(kind=iwp) :: c(0:,:,:)
            end subroutine DQCoeff
    end interface

    interface
        subroutine Ljk(j,xlist0,xlist1, k, res)
            implicit none
            real(16) :: xlist0(:), xlist1(:), res
            integer(4) :: j, k
        end subroutine Ljk
    end interface

    contains

    subroutine ExpandedChebyshev(ngp,res)
        implicit none
        integer(4) :: ngp,k
        real(16) :: res(ngp)
            do k = 1, ngp
                res(k) = cos((2*(ngp - k + 1.0q0) - 1.0q0)*pi/(2.0q0*ngp))/cos(pi/(2.0q0*ngp))
            end do
    end subroutine ExpandedChebyshev

end module DQ